<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>员工管理系统 - 员工管理</title>
    <link rel="stylesheet" href="styles/main.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
    <style>
        .department-icon {
            width: 24px;
            height: 24px;
            vertical-align: middle;
            margin-right: 0.5rem;
            transition: transform 0.2s ease;
        }
        
        .department-icon:hover {
            transform: scale(1.2);
        }
        
        .employee-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            margin-right: 0.5rem;
            vertical-align: middle;
            object-fit: cover;
            border: 2px solid #4CAF50;
            transition: all 0.3s ease;
        }
        
        .employee-avatar:hover {
            transform: scale(1.1);
            border-color: #2196F3;
        }
        
        .employee-row {
            transition: background-color 0.3s ease;
        }
        
        .employee-row:hover {
            background-color: rgba(76, 175, 80, 0.1);
        }
        
        .btn-edit, .btn-delete {
            padding: 0.5rem;
            border-radius: 50%;
            width: 36px;
            height: 36px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin: 0 0.3rem;
            transition: all 0.3s ease;
        }
        
        .btn-edit:hover, .btn-delete:hover {
            transform: scale(1.1);
        }
        
        .department-select {
            padding: 0.5rem;
            border: 1px solid #ddd;
            border-radius: 4px;
            background-color: white;
            font-size: 14px;
        }
        
        .department-select:focus {
            outline: none;
            border-color: #4CAF50;
            box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
        }
        
        .edit-form {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            padding: 2rem;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            z-index: 1000;
        }
        
        .edit-form input,
        .edit-form select {
            width: 100%;
            margin-bottom: 1rem;
        }
        
        .edit-form-buttons {
            display: flex;
            justify-content: flex-end;
            gap: 1rem;
        }
    </style>
</head>
<body>
    <nav>
        <ul>
            <li><a href="index.html">首页</a></li>
            <li><a href="employees.html" class="active">员工管理</a></li>
            <li><a href="attendance.html">考勤记录</a></li>
        </ul>
    </nav>
    <main>
        <h1>员工管理</h1>
        <div class="controls">
            <button onclick="showAddEmployeeForm()">
                <i class="fas fa-plus"></i> 添加员工
            </button>
        </div>
        <table id="employeeTable">
            <thead>
                <tr>
                    <th>工号</th>
                    <th>姓名</th>
                    <th>部门</th>
                    <th>职位</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody id="employeeList"></tbody>
        </table>
    </main>
    <div id="editForm" class="edit-form" style="display: none;">
        <h2>编辑员工信息</h2>
        <input type="text" id="editName" placeholder="姓名">
        <select id="editDepartment">
            <option value="技术部">技术部</option>
            <option value="市场部">市场部</option>
            <option value="人事部">人事部</option>
            <option value="财务部">财务部</option>
        </select>
        <input type="text" id="editPosition" placeholder="职位">
        <div class="edit-form-buttons">
            <button onclick="cancelEdit()" class="btn-delete">取消</button>
            <button onclick="saveEdit()" class="btn-edit">保存</button>
        </div>
    </div>
    <script src="js/employees.js"></script>
</body>
</html> 